package ch15;

import junit.framework.TestCase;
import org.junit.jupiter.api.Test;

/**
 * Created by zhangyunqi on 2017/10/18.
 */
public class CircularArrayQueueTest extends TestCase{


    CircularArrayQueue <String> queue = new CircularArrayQueue <String> ();
    @Test
    public void testdequeue() {
        queue.enqueue ( "20162307" );
        assertEquals ( 1,queue.size () );
        queue.dequeue ();
        assertEquals ( 0,queue.size () );
    }

    @Test
    public void testfirst() {
        queue.enqueue ( "java,java" );
        queue.enqueue ( "qqqqqqqqqq" );
    }

    @Test
    public void testisEmpty() {
        assertEquals ( 0,queue.size () );
        assertEquals ( true,queue.isEmpty () );
        queue.enqueue ( "zyqzyq" );
        assertEquals ( false,queue.isEmpty () );
    }

    @Test
    public void testsize() {
        assertEquals ( 0,queue.size () );
        queue.enqueue ( "2" );
        queue.enqueue ( "3" );
        queue.enqueue ( "0" );
        queue.enqueue ( "7" );
        assertEquals ( 4,queue.size ());
    }

    @Test
    public String testtoString() {
        return null;
    }

}